package com.华为OD;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class t17非递减数字子串 {
    public static int MaxLength(String str) {
        int i=0,j=1;
        int max = 1;
        while (j<str.length()) {
            if (str.charAt(j)-str.charAt(j-1)<0) {
                max = Math.max(max,j-i);
                i = j;
            }
            j++;
        }
        max = Math.max(max,j-i);
        return max;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Pattern p = Pattern.compile("[0-9]+");
        Matcher m = p.matcher(in.next());
        int max = 0;
        while (m.find()) {
            String s= m.group();
            max = Math.max(max,MaxLength(s));
        }
        System.out.println(max);
    }
}
